// ValidationAspects
// Written by Mike Saunders
// Released under Microsoft Public License (Ms-PL)
using System;

namespace ValidationAspects.Sdk
{
	public abstract class ValidatorFactoryBase<TValue> : IValidatorFactory
	{
		protected abstract Action<TValue, IValidationContext> ValidateAction { get; }

		#region Implementation of IValidatorFactory
		public virtual IValidator<T> Create<T>()
		{
			return Adapt<T, TValue>.From(new Validator<TValue>(ValidateAction));
		}
		#endregion
	}
}